from django.db import models
from django.utils.translation import gettext_lazy as _
# Create your models here.

class AppStore(models.Model):
    name = models.CharField(_("title_name"), max_length=128)
    type = models.CharField(
        _("format"),
        max_length=12,
        choices=(("os", "操作系统"), ("application","应用程序"),),
        default='os'
    )
    kernel = models.CharField(_("kernel"), max_length=128)
    vcpu = models.IntegerField(_("vCpu"), default=2)
    ram = models.IntegerField(_("Ram(GB)"), default=8192)
    sysdisk = models.IntegerField(_("Sysdisk(GB)"))
    titimg = models.ImageField(upload_to='appstoreimg')
    volimg = models.CharField(_("volimg"), max_length=128)

    class Meta:
        db_table = 'table_appstore_info'
        verbose_name = 'AppStore'
        verbose_name_plural = verbose_name

    def __str__(self):
        return f"{self.name}"